package com.team5.service.impl;

import java.util.Arrays;
import java.util.List;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.team5.entity.ChinaIndex;
import com.team5.mapper.ChinaIndexMapper;
import com.team5.service.ChinaIndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ChinaIndexServiceImpl implements ChinaIndexService {
    @Autowired
    private ChinaIndexMapper mapper;
    @Override
    public ChinaIndex findById(Integer id) {
        return mapper.findById(id);
    }

    @Override
    public ChinaIndex[] findAll() {
        return mapper.findAll();
    }
    @Override
    public PageInfo findByPage(int pageNum,int pageSize){
        PageHelper.startPage(pageNum,pageSize);
        List<ChinaIndex> chinaIndexList=mapper.list();
        PageInfo<ChinaIndex> pageInfo=new PageInfo<>(chinaIndexList);
        return pageInfo;
    }
}
